﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yima.AdoDotNet;
using Yima.AdoDotNet.impl;
using Yima.AdoDotNet.UnitOfWork;
using Yima.Infrastructure.Attributes;

namespace ConsoleApp2
{
	class Program
	{
		[TableName("T_tableA")]
		public class Model
		{
			public Model()
			{

			}

			public int Ina { get; set; }
			public string Title { get; set; }
		}
		public class MyUnitOfWorkContext : UnitOfWorkContext
		{
			public MyUnitOfWorkContext()
			{

			}

			public override string Key => "Listen";
		}

		public class MyBaseRepository<T> : BaseRepository<T>
			 where T : class, new()
		{
			public MyBaseRepository(IUnitOfWork unitOfWork, IUnitOfWorkContext context) : base(unitOfWork, context)
			{

			}

		}

		static void Main(string[] args)
		{
			var ct = new MyUnitOfWorkContext();
			var a = new MyBaseRepository<Model>(new MyUnitOfWork(ct), ct);
			var b = a.Query(o => o.Ina > 8 && o.Title.StartsWith("ft") 
			&& o.Title.Trim().StartsWith("ft"));
			Console.WriteLine("Hello World!");
		}
	}
}
